package com.example.simpleFactory;

import com.example.simpleFactory.father.FruitsBehavior;
import com.example.simpleFactory.father.extend.Apple;
import com.example.simpleFactory.father.extend.Banana;

public class SimpleFactory {
    public FruitsBehavior getFruitsBehavior(String fruit) {
        if (fruit == null) {
            return null;
        }
        switch (fruit) {
            case "Apple": return new Apple();
            case "Banana": return new Banana();
        }

        return null;
    }
}
